package server.rest.sessions;

public class Session<KEY, ID>
{
    protected final KEY key;
    protected final ID id;
    protected final long created;
    protected long lastRefresh;

    public Session(KEY key, ID id)
    {
        this.key = key;
        this.id = id;
        this.lastRefresh = this.created = System.currentTimeMillis();
    }

    void refresh()
    {
        this.lastRefresh = System.currentTimeMillis();
    }

    public KEY getKey()
    {
        return key;
    }

    public ID getId()
    {
        return id;
    }

    public long getCreated()
    {
        return created;
    }

    public long getLastRefresh()
    {
        return lastRefresh;
    }

}
